<template>
  <div>
    <el-menu
        style="width: 200px; min-height: calc(100vh - 50px)"
        :default-active="path"
        class="el-menu-vertical-demo"
        router
        @open="handleOpen"
        @close="handleClose"
    >

      <el-menu-item index="/start">
        <el-icon color="#409EFC" class="no-inherit">
          <House />
        </el-icon>
        <span>主页</span>
      </el-menu-item>
      <el-menu-item index="/student">
        <template #title>
          <el-icon><Edit /></el-icon>
          <span>学生管理</span>
        </template>
      </el-menu-item>
      <el-menu-item index="/course">
        <el-icon><Memo /></el-icon>
        <span>课程总管理</span>
      </el-menu-item>
      <el-menu-item index="/user">
        <el-icon><Tickets /></el-icon>
        <span>用户信息浏览</span>
      </el-menu-item>
      <el-menu-item index="/cet">
        <el-icon><Tickets /></el-icon>
        <span>六级单词</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
import { Edit } from '@element-plus/icons-vue' // 引入 Edit 这个 svg组件
import { House } from '@element-plus/icons-vue' // 引入 Edit 这个 svg组件
import { Memo } from '@element-plus/icons-vue' // 引入 Edit 这个 svg组件
import { Tickets } from '@element-plus/icons-vue' // 引入 Edit 这个 svg组件
export default {
  name: "aside.vue",
  components:{
    Edit,
    House,
    Memo,
    Tickets,
  },
  data(){
    return{
      user:{},
      path: this.$route.path    //设置默认高亮的菜单
    }

  },
  created() {
    let userStr = sessionStorage.getItem("user")
    this.user = JSON.parse(userStr)
    // console.log(this.user)

  }
}
</script>

<style scoped>

</style>